@include('admin.header')
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="/mobile/agent">区域代理</a></li>
		</ul>
		<form class="js-ajax-form" action="" method="post">
			<div class="well form-search" method="post" action="{{asset('mobile/index')}}">
				关键字：
				<input type="text" name="keywords" style="width: 200px;" value="{{$keywords or ''}}" placeholder="区域代理名称">
				<input type="submit" class="btn btn-primary" value="搜索" />
			</div>
			<div class="js-ajax-form" action="" method="post">
				<div class="table-actions">
				</div>
				<table class="table table-hover table-bordered table-list">
					<thead>
						<tr>
							<th>ID</th>
							<th>申请人</th>
							<th>区域代理名称</th>
							<th>地区</th>
							<th>详细地址</th>
							<th>状态</th>
							<th>备注</th>
							<th>时间</th>
							<th>操作</th>
						</tr>
					</thead>
					@foreach($data as $key => $vo)
						<tr>
							<td><b>{{$vo->id}}</b></td>
							<td><b>{{$vo->nodename}}</b></td>
							<td>{{$vo->name}}</td>
							<td>{{$vo->region_id}}</td>
							<td>{{$vo->address}}</td>
							<td>
								@if($vo->status == 0)
									禁用
								@else
									正常
								@endif
							</td>
							<td>{{$vo->remarks}}</td>
							<td>{{$vo->create_time}}</td>
							<td>
								<a href="{{asset('mobile/agent_edit')}}?id={{$vo->id}}">编辑</a>
							</td>
						</tr>
					@endforeach
					<tfoot>
					<tr>
						<th>ID</th>
						<th>申请人</th>
						<th>区域代理名称</th>
						<th>地区</th>
						<th>详细地址</th>
						<th>状态</th>
						<th>备注</th>
						<th>时间</th>
						<th>操作</th>
					</tr>
					</tfoot>
				</table>
				<div class="table-actions">
				</div>
				<div class="pagination">{{$data->render()}}</div>
			</div>
		</form>
	</div>
	<script src="/static/js/common.js"></script>
	<script>
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location = "{:U('AdminPost/index',$formget)}";
			}
		}
		setInterval(function() {
			refersh_window();
		}, 2000);
		$(function() {
			laydate({
				elem: '#test1',
				format: 'YYYY/MM', // 分隔符可以任意定义，该例子表示只显示年月
				festival: true, //显示节日
				choose: function(datas){ //选择日期完毕的回调
					alert('得到：'+datas);
				}
			});
			setCookie("refersh_time", 0);
			Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
				//批量复制
				$('.js-articles-copy').click(function(e) {
					var ids=[];
					$("input[name='ids[]']").each(function() {
						if ($(this).is(':checked')) {
							ids.push($(this).val());
						}
					});
					
					if (ids.length == 0) {
						art.dialog.through({
							id : 'error',
							icon : 'error',
							content : '您没有勾选信息，无法进行操作！',
							cancelVal : '关闭',
							cancel : true
						});
						return false;
					}
					
					ids= ids.join(',');
					art.dialog.open("__ROOT__/index.php?g=portal&m=AdminPost&a=copy&ids="+ ids, {
						title : "批量复制",
						width : "300px"
					});
				});
				//批量移动
				$('.js-articles-move').click(function(e) {
					var ids=[];
					$("input[name='ids[]']").each(function() {
						if ($(this).is(':checked')) {
							ids.push($(this).val());
						}
					});
					
					if (ids.length == 0) {
						art.dialog.through({
							id : 'error',
							icon : 'error',
							content : '您没有勾选信息，无法进行操作！',
							cancelVal : '关闭',
							cancel : true
						});
						return false;
					}
					
					ids= ids.join(',');
					art.dialog.open("__ROOT__/index.php?g=portal&m=AdminPost&a=move&old_term_id={$term.term_id|default=0}&ids="+ ids, {
						title : "批量移动",
						width : "300px"
					});
				});
			});
		});
	</script>
</body>
</html>